package net.yla.smartbus.core.exception;

/**
 * 所有项目子业务中出现的自定义异常需继承此公共业务型异常
 *
 * @author ZengXiaoLiang
 */
public class AppException extends RuntimeException {
    private int errorCode;
    private int data;
    private Integer dataAssist;

    public AppException(String msg, int code) {
        super(msg);
        this.errorCode = code;
    }
    public AppException(String msg, int code, int data) {
        super(msg);
        this.errorCode = code;
        this.data = data;
    }

    public static int buildErrorCode(int code) {
        return code;
    }

    public int getErrorCode() {
        return this.errorCode;
    }

    public static int buildErrorData(int data) {
        return data;
    }

    public int getErrorData() {
        return this.data;
    }
    public int getErrorDataAssist() {
        return this.dataAssist;
    }

}